import request from '@/api/request.js';

// 登录
export const login = data => {
  return request({
    method: 'post',
    url: '/login',
    data,
  });
};

// 注册
export const register = data => {
  return request({
    method: 'post',
    url: '/register',
    data,
  });
};

//退出登录
export const logout = username => {
  return request({
    method: 'post',
    url: '/logout',
    headers: {
      'Content-Type': 'application/json',
    },
    data: {
      username: username,
    },
  });
};
